﻿#pragma once
#include "InputStream.h"
#include "array/Array.hpp"

namespace yzrilyzr_io{
	ECLASS(ByteArrayInputStream, public InputStream){
	protected:
	yzrilyzr_array::ByteArray buf;
	u_index pos;
	public:
	ByteArrayInputStream(const yzrilyzr_array::ByteArray &s);
	~ByteArrayInputStream()=default;
	int32_t read() override;
	using InputStream::read;
	u_index read(yzrilyzr_array::ByteArray & b, u_index off, u_index len) override;
	u_index available() override;
	void close() override;
	};
}